package db6;

public class HourlyEmployee extends ColaEmployee{
    double hoursalary;
    double monthhours;
    public HourlyEmployee(String name,int bir,double hoursalary,double monthhours){

        super(name,bir);
        this.hoursalary=hoursalary;
        this.monthhours=monthhours;
    }
    @Override
    public double getSalary(int month) {
        double salary=0;
        if (hoursalary > 160) {
            salary=(monthhours-160)*1.5*hoursalary+hoursalary*160;
        }else {
            salary=hoursalary*monthhours;
        }
        return salary;
    }
}
